import { createRouter, createWebHistory } from "vue-router";
import Home from "../views/Home.vue";
// 路由
const router = createRouter({
  history: createWebHistory("/"),
  routes: [
    {
      path: "/",
      name: "Home",
      component: Home,
    },
    {
      path: "/about",
      name: "About",
      component: () => import("../views/about/index.vue"),
      children: [
        {
          path: "summary", // 不需要前导斜杠
          name: "AboutSummary",
          component: () => import("../views/about/summary.vue"),
        },
        {
          path: "culture", // 不需要前导斜杠
          name: "AboutCulture",
          component: () => import("../views/about/culture.vue"),
        },
      ],
    },
    {
      path: "/news",
      name: "News",
      component: () => import("@/views/news/index.vue"),
      children: [
        {
          path: "dynamics",
          name: "NewsDynamics",
          component: () => import("@/views/news/dynamics.vue"),
        },
        {
          path: "industry",
          name: "NewsIndustry",
          component: () => import("@/views/news/industry.vue"),
        },
        {
          path: "industrydetails",
          name: "NewsIndustryDetails",
          component: () => import("@/views/news/industrydetails.vue"),
        },
        {
          path: "dynamicsdetails",
          name: "NewsDynamicsDetails",
          component: () => import("@/views/news/dynamicsdetails.vue"),
        },
      ],
    },
    {
      path: "/warranty",
      name: "Warranty",
      component: () => import("@/views/warranty/index.vue"),
      children: [
        {
          path: "concept",
          name: "WarrantyConcept",
          component: () => import("@/views/warranty/concept.vue"),
        },
        {
          path: "scope",
          name: "WarrantyScope",
          component: () => import("@/views/warranty/scope.vue"),
        },
        {
          path: "brands",
          name: "WarrantyBrands",
          component: () => import("@/views/warranty/brands.vue"),
        },
      ],
    },
    {
      path: "/service",
      name: "Service",
      component: () => import("@/views/service/index.vue"),
      children: [
        {
          path: "notice",
          name: "ServiceNotice",
          component: () => import("@/views/service/notice.vue"),
        },
        {
          path: "process",
          name: "ServiceProcess",
          component: () => import("@/views/service/process.vue"),
        },
        {
          path: "faq",
          name: "ServiceFAQ",
          component: () => import("@/views/service/faq.vue"),
        },
      ],
    },
    {
      path: "/jobs",
      name: "Jobs",
      component: () => import("@/views/jobs/index.vue"),
      children: [
        {
          path: "list",
          name: "JobsList",
          component: () => import("@/views/jobs/list.vue"),
        },
        {
          path: "resume",
          name: "JobsResume",
          component: () => import("@/views/jobs/resume.vue"),
        },
        {
          path: "position",
          name: "JobsPosition",
          component: () => import("@/views/jobs/position.vue"),
        },
      ],
    },
    {
      path: "/contact",
      name: "Contact",
      component: () => import("@/views/contact/index.vue"),
    },
  ],
});
// 导出
export default router;
